<div appBsModal #modal="bs-modal" class="modal fade" [ngClass]="modalExpandOb.className"  tabindex="-1" role="dialog" aria-labelledby="modal"
    aria-hidden="true" [config]="{backdrop: 'static'}">
    <div class="modal-dialog modal-xl">
        <div class="modal-content">
            <div class="modal-header" style="padding:0.5rem">
                <h5 class="modal-title">
                    <span>{{title + (data.id?'('+data.id+')':'')}}</span>
                </h5>
                <span class="pull-right">
                    <a class="btn btn-smallEx" (click)='modalExpandOb.modalExHandle("small")'>
                        <i class="bi bi-arrows-angle-expand" *ngIf="!modalExpandOb.isSmallEx"></i>
                        <i class="bi bi-arrows-angle-contract" *ngIf="modalExpandOb.isSmallEx"></i>
                    </a>
                    <a class="btn btn-fullscreen" (click)='modalExpandOb.modalExHandle("full")'>
                        <i class="bi bi-arrows-fullscreen" *ngIf="!modalExpandOb.isFullScreen"></i>
                        <i class="bi bi-fullscreen-exit" *ngIf="modalExpandOb.isFullScreen"></i>
                    </a>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <i aria-hidden="true" class="bi bi-x"></i>
                    </button>
                </span>
            </div>
            <div class="modal-body"  [busyIf]="loading">
                <div class="row">
                    <div class="col-sm-4">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <label>{{"Name" | localize}}</label>
                            <input class="form-control" type="text" [ngClass]="{'edited':data.name}" [(ngModel)]="data.name" name="configName" required maxlength="32" />
                        </div>
                    </div>
                    <div class="col-sm-4">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <label>Key</label>
                            <input class="form-control" type="text" [ngClass]="{'edited':data.key}" [(ngModel)]="data.key" name="key" required maxlength="32" />
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="form-group form-md-line-input form-md-floating-label no-hint">
                            <label>{{"Type" | localize}}</label>
                            <select class="form-control edited" [(ngModel)]="data.dataType" name="dataType"  (change)="dataTypeChanged()">
                                <option value="{{op}}" *ngFor="let op of dataTypes" >{{op}}</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-2">
                        <div class="checkbox-list">
                            <label class="checkbox">
                                <input id="config_isActive" type="checkbox" name="isActive" [(ngModel)]="data.isActive" >
                                <span></span>
                                {{"ReleaseState" | localize}}
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group form-md-line-input form-md-floating-label no-hint">
                    <label>{{"Description" | localize}}</label>
                    <textarea class="form-control" rows="4" [ngClass]="{'edited':data.description}" [(ngModel)]="data.description" required name="description"  maxlength="250"></textarea>
                </div>
                <div class="form-group">
                    <label>{{"CustomConfig" | localize}}</label>
                    <json-editor [options]="editorOptions" [hidden]="formEdit" [(data)]="jsonData" #editor></json-editor>
                </div>

            </div>
            <div class="modal-footer">
                <button [disabled]="saving" type="button" class="btn btn-default font-weight-bold mr-1"
                        (click)="close()">
                    {{"Cancel" | localize}}
                </button>
                <button class="btn btn-primary blue"  [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')" 
                 *ngIf="['Pages.Administration.CustomConfigs.Create','Pages.Administration.CustomConfigs.Edit']| permissionAny" (click)="save()"><i class="fa fa-save"></i>{{"Save" | localize}}</button>
            </div>
        </div>
    </div>
</div>